<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="layui-v2.6.8/layui/css/layui.css">
    <script src="layui-v2.6.8/layui/layui.js"></script>
    <style>
        .aa{
            width:140px;
            height: 80px;
        }
    </style>
</head>

<body>
    <input type="button" value="弹出层" class="layui-btn layui-btn-danger" onclick="doOpen()">
    <script>
        function doOpen() {
            //使用弹出层，加载弹出层模块
            layui.use('layer', function () {
                var layer = layui.layer;
                var tanChucengIndex=layer.open({
                    type: 1,
                    title:"用户修改",
                    area: ['500px', '300px'],
                    content: '<div><input type="text" class="aa"></div>', //这里content是一个普通的String

                    btn: ['取消', '保存']
                    ,yes: function(index, layero){
                        console.log("yes");
                        // layer.close(tanChucengIndex);//关闭弹出层

                        layer.closeAll();//关闭所有弹出层
                        //按钮【按钮一】的回调
                    }
                    ,btn2: function(index, layero){
                        //按钮【按钮二】的回调
                        console.log("第二个按钮");
                        //return false 开启该代码可禁止点击该按钮关闭
                    }
                  
                    ,cancel: function(){ 
                        //右上角关闭回调
                        
                        //return false 开启该代码可禁止点击该按钮关闭
                    }
                });

             
            });
        }
    </script>
</body>

</html>